package com.example.sonone;

import com.example.sonone.dao.jizhuangxiangDao;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.text.DecimalFormat;
import java.text.Format;
import java.util.*;

@RunWith(SpringRunner.class)
@SpringBootTest
public class jizhuangxinagshuju {


    @Autowired
    private jizhuangxiangDao ji;

    /**
     * 集装箱造假数据
     */
    @Test
    public void test() {


        List<String> lists = ji.selectId();


        lists.stream().forEach(n -> {
            List<Map<String, Object>> list = new ArrayList<>();
            for (int i = 1; i <= 13; i++) {
                Map<String, Object> map = new HashMap<>();
                map.put("appointId", n);
                map.put("prealTypeId", String.valueOf(i));

                list.add(map);

            }
            ji.insert(list);

        });


    }


    public static void main(String[] args) {
        int num = 13;

        Format f1 = new DecimalFormat("000");
        System.out.println(f1.format(num));

        Format f2 = new DecimalFormat("00");
        System.out.println(f2.format(num));
    }


}
